added xcsv-derivative logic
authorparkrrrr <parkrrrr@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 17 May 2006 20:28:39 +0000 (20:28 +0000)
committerparkrrrr <parkrrrr@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 17 May 2006 20:28:39 +0000 (20:28 +0000)
gpsbabel/xmldoc/makedoc

index 0b44516f28c6f650f5ac83fbc411feb63c7bd3d1..2a7ad3710dccd6e8ec25568eb1070f9a8949186a 100755 (executable)
@@ -73,6 +73,7 @@ print FORMATS qq(<!-- This document is automatically generated. -->\n);
 @formats = `gpsbabel -^3`;
 
 $going = 0;
+$dooptions = 0;
 
 for (@formats) {
    chomp;
@@ -87,9 +88,12 @@ for (@formats) {
        close FILE;
        $going = 0;
      }
+     if ( $line[5] eq 'xcsv' ) {
+       $line[0] = 'file';
+     }
    }
 
-   elsif (($line[0] eq 'file') || ($line[0] eq 'serial')) {
+   if (($line[0] eq 'file') || ($line[0] eq 'serial')) {
      if ($going) {
        print FILE "</section>\n";
        close FILE;
@@ -111,8 +115,20 @@ END
      print FILE expandoptions($line[1]);
      include($id,'formats');
      $going = 1;
+     $dooptions = 1;
+     if ( defined($line[5]) && ($line[5] ne $line[2]) ) {
+       print FILE <<END;
+<para>
+This format is derived from the <link linkend="fmt_$line[5]">$line[5]</link>
+format, so it has all of the same objects as that format.
+</para>
+END
+       if ($line[5] eq 'xcsv' ) {
+         $dooptions=0;
+       }
+     }
    }
-   elsif ($going && ($line[0] eq 'option')) {
+   elsif ($going && $dooptions && ($line[0] eq 'option')) {
      $nid = 'fmt_'.$id.'_o_'.$line[2];
      print FILE <<END;
   <section id="$nid">